package com.nbsaas.boot.wms.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.math.BigDecimal;
import java.util.Date;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "商品配货", model = "商品配货")
@Entity
@Table(name = "bs_product_allocation")
@Comment("商品配货表")
public class ProductAllocation extends AbstractEntity {

    @Comment("商品ID")
    @SearchItem(name = "productId", key = "productId", label = "商品ID")
    @FormField(title = "商品ID", sortNum = "1", grid = true, required = true)
    private Long productId;

    @Comment("SKU ID")
    @FormField(title = "SKU ID", sortNum = "2", grid = true, required = true)
    private Long skuId;

    @Comment("店铺ID")
    @SearchItem(name = "shopId", key = "shopId", label = "店铺ID")
    @FormField(title = "店铺ID", sortNum = "3", grid = true, required = true)
    private Long shopId;

    @Comment("仓库ID")
    @FormField(title = "仓库ID", sortNum = "4", grid = true, required = true)
    private Long warehouseId;

    @Comment("配货数量")
    @FormField(title = "配货数量", sortNum = "5", grid = true, type = InputType.el_input_number, sort = true)
    private Integer allocationQuantity;

    @Comment("可用配货数量")
    @FormField(title = "可用配货数量", sortNum = "6", grid = true, type = InputType.el_input_number, sort = true)
    private Integer availableQuantity;

    @Comment("锁定配货数量")
    @FormField(title = "锁定配货数量", sortNum = "7", grid = true, type = InputType.el_input_number, sort = true)
    private Integer lockedQuantity;

    @Comment("配货状态")
    @FormField(title = "配货状态", sortNum = "8", grid = true, type = InputType.select)
    @Column(length = 20)
    private String status; // AVAILABLE-可用, LOCKED-锁定, UNAVAILABLE-不可用

    @Comment("配货类型")
    @FormField(title = "配货类型", sortNum = "9", grid = true, type = InputType.select)
    @Column(length = 20)
    private String allocationType; // NORMAL-正常配货, PROMOTION-促销配货, RESERVED-预留配货

    @Comment("配货优先级")
    @FormField(title = "配货优先级", sortNum = "10", grid = true, type = InputType.el_input_number, sort = true)
    private Integer priority;

    @Comment("配货开始时间")
    @FormField(title = "配货开始时间", sortNum = "11", grid = true, type = InputType.date)
    private Date allocationStartTime;

    @Comment("配货结束时间")
    @FormField(title = "配货结束时间", sortNum = "12", grid = true, type = InputType.date)
    private Date allocationEndTime;

    @Comment("配货备注")
    @FormField(title = "配货备注", sortNum = "13", type = InputType.richText, col = 23)
    @Column(length = 1000)
    private String note;
} 